package proxy_cglib;

import proxy_jdk.Customer;

import java.util.ArrayList;
import java.util.List;

/**
 * 因为cglib是通过继承的方式实现，所以不需要定义接口，直接定义目标类就可以
 * 目标类中定义具体的执行方法就ok
 */
public class CustomerCRUD_cglib{

    public void addCustomer(Customer customer) {
        System.out.println("添加成功");
    }

    public void deleteCustomer(String id) {
        System.out.println("删除成功");
    }

    public void updateCustomer(Customer customer) {
        System.out.println("更新成功");
    }

    public List<Customer> queryAllCustomers() {
        System.out.println("查找成功");
        List<Customer> customerList = new ArrayList<>();
        customerList.add(new Customer());
        customerList.add(new Customer());
        customerList.add(new Customer());
        return customerList;
    }
}
